<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'pages-form',
	'enableAjaxValidation'=>false,
)); ?>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'title'); ?>
	</div>
<div class="row">
<?php $this->widget('application.components.TinyMceWidget', array(
    'model'=>$model,
    'attribute'=>'text',
    'editorOptions'=>array(
        'width'=>'700',
        'height'=>'300',
    ),
));
?>
<?php echo $form->error($model,'text'); ?><br>
</div>    
<style>.ui-accordion {width: 700px;} </style>
<?php
$this->widget('zii.widgets.jui.CJuiAccordion', array(
    'panels'=>array(
        'Дополнительные параметры страницы'=> $this->renderPartial('_form_ext',array(
            'model'=> $model,
            'form' => $form,
        ), true),
    ),
    // additional javascript options for the accordion plugin
    'options'=>array(
        'active'=>'1',
    ),
));
?><br>

<? $this->widget('ext.EAjaxUpload.EAjaxUpload',
array(
    'id'=>'uploadFile',
    'config'=>array(
       'action'=> '/index.php?r=site/upload',
       'allowedExtensions'=>array('jpg','jpeg','png'),//array("jpg","jpeg","gif","exe","mov" and etc...
       'sizeLimit'=>8*1024*1024,// maximum file size in bytes
       //'minSizeLimit'=> 1,// minimum file size in bytes
       'onComplete'=> "js:function(id, fileName, responseJSON){ alert(fileName); }",
       'messages'=>array(
                         'typeError'=>"{file} has invalid extension. Only {extensions} are allowed.",
                         'sizeError'=>"{file} is too large, maximum file size is {sizeLimit}.",
                         'minSizeError'=>"{file} is too small, minimum file size is {minSizeLimit}.",
                         'emptyError'=>"{file} is empty, please select files again without it.",
                         'onLeave'=>"The files are being uploaded, if you leave now the upload will be cancelled."
                        ),
       //'showMessage'=>"js:function(message){ alert(message); }"
      )
)); ?>

<div class="row buttons">
    <?php echo CHtml::submitButton($model->isNewRecord ? 'Создать' : 'Сохранить'); ?>
    <?php echo CHtml::button('Отмена', array('onclick'=>"document.location.href='" .  Yii::app()->createUrl('/pages/pages/admin') . "';")); ?>
</div>
<?php $this->endWidget(); ?>

</div><!-- form -->